import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_scaffold_ohos/getx_scaffold_ohos.dart';

import '../../gen_a/A.dart';
import 'login_controller.dart';

class LoginPage extends StatelessWidget {
  LoginPage({super.key});

  final LoginController controller = Get.put(LoginController());

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: AppBar(
        title: Text(
          '登录',
          style: TextStyle(
              color: Colors.black,
              fontSize: 18.sp,
              fontWeight: FontWeight.bold),
        ),
        centerTitle: true,
        elevation: 0.1,
      ),
      body: SafeArea(
        child: GetBuilder<LoginController>(
          id: "login",
          init: controller,
          builder: (controller) {
            return Column(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                SizedBox(height: 60.h),
                Image.asset(
                  A.assets_images_ic_launcher,
                  width: 82.r,
                  height: 82.r,
                ),
                SizedBox(height: 10.h),
                Text(
                  '登录之后,\n即刻体验TODO',
                  style: TextStyle(color: Colors.black, fontSize: 16.sp),
                  textAlign: TextAlign.center,
                ).center().marginOnly(bottom: 30.h),
                TextField(
                  decoration: InputDecoration(
                    hintText: '请输入用户名',
                    hintStyle: TextStyle(
                        color: Colors.black.withOpacity(0.5), fontSize: 14.sp),
                    border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(24.r),
                        borderSide: BorderSide.none),
                    filled: true,
                    fillColor: const Color(0xFFF6F6F6),
                  ),
                ).height(48.h).marginSymmetric(horizontal: 26.w).marginOnly(bottom: 20.h),
                TextField(
                  decoration: InputDecoration(
                    hintText: '请输入密码',
                    hintStyle: TextStyle(
                        color: Colors.black.withOpacity(0.5), fontSize: 14.sp),
                    border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(24.r),
                        borderSide: BorderSide.none),
                    filled: true,
                    fillColor: const Color(0xFFF6F6F6),
                  ),
                  obscureText: true,
                ).height(48.h).marginSymmetric(horizontal: 26.w).marginOnly(bottom: 20.h),
                ElevatedButton(onPressed: (){}, child: Text('登录', style: TextStyle(color: Colors.white, fontSize: 16.sp),)),
                TextButton(onPressed: (){}, child: Text('去注册'))
              ],
            ).width(double.infinity);
          },
        ),
      ),
    );
  }
}
